﻿using System;
using System.Collections.Generic;
using System.Text;
using Ch.Admin.Bfs.Sms.Sdmx.Extension.CodeBook.Configuration;

namespace Ch.Admin.Bfs.Sms.Sdmx.Extension.CodeBook.Meta
{
    public interface IMetaProviderFactory
    {
        IMetaProvider GetMetaProvider(TableOfContents moduleType, string language, string metaFullId, BookConfiguration cfg);

        HierarchyNode ReferedCodelistModuleContent();

        void ClearReferedCodelist();
    }

    public interface IMetaProvider
    {
        // Maintenable artefact meta fullId (Agency+Id+version)
        string FullIdKey { get; }

        // Node holding root info of maintenable artefact, hierarchy represented in child nodes
        HierarchyNode GetRootNode();

        // List of nodes presenting Annotations info (ID = Type, Name = Text, Descr = Title)
        List<HierarchyNode> GetAnnotations(HierarchyNode node);

        // Variable type (from item in MSD, DSD or ConceptScheme
        string GetVariableType(HierarchyNode node);

        // Variable type detail as list of pair ( property and value)
        List<KeyValuePair<string, string>> GetTypeDetail(HierarchyNode node);

        // Obtains a Node holding FullId and Name of the refered codelist attached to node
        HierarchyNode GetCodelistReference(HierarchyNode node);

    }
}
